(function () {
  // 步骤3：创建echarts实例
  let myChart = echarts.init(document.querySelector(".box9"));

  console.log(myChart);

  // 步骤4：定义配置（指定图表的配置项和数据）
  let option = {
    tooltip: {
      trigger: "item",
    },
    legend: {
      top: "top",
      textStyle: {
        color: "#666e8c",
      },
    },
    series: [
      {
        name: "Nightingale Chart",
        type: "pie",
        radius: [10, 70],
        center: ["50%", "50%"],
        roseType: "area",
        itemStyle: {
          borderRadius: 2,
        },
        data: [
          { value: 50, name: "rose 1" },
          { value: 45, name: "rose 2" },
          { value: 38, name: "rose 2" },
          { value: 32, name: "rose 3" },
          { value: 30, name: "rose 4" },
          { value: 28, name: "rose 5" },
        ],
      },
    ],
  };

  // 步骤5：使用刚指定的配置项和数据显示图表
  myChart.setOption(option);

  window.onresize = function () {
    myChart.resize();
  };
})();
